#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int cmp(int* a, int* b) {
    return *a - *b;
}
int* findErrorNums(int* nums, int numsSize, int* returnSize) {
    int* arr = malloc(sizeof(int) * 2);
    *returnSize = 2;
    qsort(nums, numsSize, sizeof(int), cmp);
    int n1 = 0;
    for (int i = 0;i < numsSize;i++)
    {
        if (nums[i] == n1)
        {
            arr[0] = n1;
        }
        else if (nums[i] - n1 > 1)
        {
            arr[1] = nums[i] - 1;
        }
        n1 = nums[i];
    }
    if (nums[numsSize - 1] != numsSize)
    {
        arr[1] = numsSize;
    }
    return arr;
}